/*
 * Copyright (c) 2018—2020 MIDU.Co.Ltd. All rights reserved.
 *
 * Description:  SHA256 implementation
 *
 */

#pragma once
#define SHA256_DIGEST_SIZE 32

#include <stdint.h>
#include <cstdio>

typedef struct {
  uint32_t H[8];
  uint64_t Count;
  uint8_t Buffer[64];
} sha256_context;

void sha256_init(sha256_context *ctx);
void sha256_process(sha256_context *ctx, const void *Data, size_t Size);
void sha256_done(sha256_context *ctx, uint8_t *Digest);
